public class Main {
    public static int fac(int n) {
        int ret = 1;
        for (int i = 1; i <= n ; i++) {
            ret *= i;
        }
        return ret;
    }
    public static int facSum(int n)  {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += fac(i);
        }
        return sum;
    }

    public static int fib(int n) {
        if (n == 1) {
            return 0;
        }
        if (n == 2) {
            return 1;
        }
        return fib(n - 2) + fib(n - 1);
    }
    public static void main(String[] args) {
        System.out.println(fac(5));
        System.out.println(facSum(5));

    }
}